JPT Preprocess Number

Introduction
You can preprocess a number using an AppleScript before the rest of the Dialing rules are applied. In this way you could strip the local country code, strip formatting, apply your own search and replace routines, etc. to the number to be dialed. Once processed by your script, the number is then run through the current Dialing Rules. To use this feature, simply create a new AppleScript in the Script Editor (or the AppleScript IDE of your choice) and include the following subroutine (adding your own preprocessing code, of course):

on preprocess_number(the_number)
	
	--apply your preprocessing code here
	
	return the_number
end preprocess_number

Save your script as a compiled AppleScript. Then, from the Dialing Rules preference window, enable the option to “Preprocess Number Using AppleScript:” and, at the prompt, select the compiled script you saved. Now, whenever you ask JPT to dial a number, the number will be processed by your script and then the result will be transformed by the current Dialing Rules. See the included example scripts for ways in which you can preprocess your numbers.

Your choice of script to use as a preprocessor is linked to the Location so you can have different scripts associated with different Locations. In this way you could determine if you were at home, and, as such, strip local area codes from your numbers or, if your were on the road, make sure your numbers always include the area code.

Any feedback you may have is appreciated  <mailto:jonn8@mac.com?subject=Re:%20Jon's%20Phone%20Tool>.

Requirements
Mac OS X 10.3 or later & Jon’s Phone Tool 3.0+

Warranty
This software is provided on an “AS IS” basis, without warranty of any kind, either expressed or implied, including, without limitation, warranties that the subject software is free of defects, merchantable, fit for a particular purpose or non-infringing. Jonathan Nathan assumes no risk as to the quality and performance of the software. Should the software prove defective in any respect, Jonathan Nathan assumes no cost or liability for any servicing, repair or correction. This disclaimer of warranty constitutes an essential part of this license. No use of any subject software is authorized hereunder except under this disclaimer.

Under no circumstances and under no legal theory, whether tort (including, without limitation, negligence or strict liability), contract, or otherwise, shall Jonathan Nathan be liable for any direct, indirect, special, incidental, or consequential damages of any character with respect to the software including, without limitation, damages for loss of goodwill, work stoppage, loss of data, computer failure or malfunction, or any and all other commercial damages or losses, even if Jonathan Nathan shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability resulting from Jonathan Nathan’s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so that exclusion and limitation may not apply to you.

You may distribute this software so long as you distribute the complete package including this Read Me document.

Copyright ©2005 Jonathan Nathan. All Rights Reserved.